home *** CD-ROM | disk | FTP | other *** search
/ Small Time Crooks Press Kit / Small Time Crooks Press Kit.iso / pc / Small Time Crooks.dxr / Scripts_3.ls < prev    next >
Encoding:
Text File  |  2000-04-30  |  2.1 KB  |  72 lines

  1. on getLabel
  2.   set lastMarker to marker(0)
  3.   repeat with n = -1 down to -1000
  4.     set nextMarker to marker(n)
  5.     if lastMarker = nextMarker then
  6.       exit repeat
  7.     end if
  8.     set lastMarker to nextMarker
  9.   end repeat
  10.   set lineNumber to n * -1
  11.   return line lineNumber of the labelList
  12. end
  13.  
  14. on SetScrollTopsToTop
  15.   repeat with whichCastLib = 1 to the number of castLibs
  16.     repeat with whichMember = 1 to the number of castMembers of castLib whichCastLib
  17.       if (whichMember = 20) and (whichCastLib = 3) then
  18.         nothing()
  19.       end if
  20.       if (the type of member whichMember of castLib whichCastLib = #field) or (the type of member whichMember of castLib whichCastLib = #richText) then
  21.         set the scrollTop of member whichMember of castLib whichCastLib to 0
  22.       end if
  23.     end repeat
  24.   end repeat
  25. end
  26.  
  27. on GetTimerString ticksCount
  28.   set sixtieths to ticksCount mod 60
  29.   set seconds to ticksCount / 60
  30.   set minutes to seconds / 60
  31.   set seconds to seconds mod 60
  32.   if sixtieths < 10 then
  33.     set sixtieths to "0" & string(sixtieths)
  34.   else
  35.     set sixtieths to string(sixtieths)
  36.   end if
  37.   if seconds < 10 then
  38.     set seconds to "0" & string(seconds)
  39.   else
  40.     set seconds to string(seconds)
  41.   end if
  42.   if minutes < 10 then
  43.     set minutes to "0" & string(minutes)
  44.   else
  45.     set minutes to string(minutes)
  46.   end if
  47.   return minutes & ":" & seconds & ":" & sixtieths
  48. end
  49.  
  50. on ScrollFieldToLine whichField, whichLine
  51.   if whichLine = 0 then
  52.     set whichLine to 1
  53.   end if
  54.   set memberNum to the number of member whichField
  55.   set linesVisible to the pageHeight of member whichField / the textHeight of field whichField
  56.   set totalLines to the number of lines in field whichField
  57.   if linesVisible > totalLines then
  58.     set topLine to 1
  59.   else
  60.     if totalLines > (whichLine + (linesVisible / 2)) then
  61.       set topLine to whichLine - (linesVisible / 2)
  62.       if topLine < 1 then
  63.         set topLine to 1
  64.       end if
  65.     else
  66.       set topLine to totalLines - linesVisible
  67.     end if
  68.   end if
  69.   set topLine to topLine - 1
  70.   set the scrollTop of member whichField to topLine * the textHeight of field whichField
  71. end
  72.